<?php
if (!defined("_INDEX")) { header("Location: /"); die; }

if (!($id = $route->getAdminId()))
	goToPage("/admin/sections?order=fail");

$order = UV::readInt($route->POST("order"));
if (!is_numeric($order))
	goToPage("/admin/sections?order=fail");

$update = $db->sendQuery("update `tip_sections` set `order` = '$order' where `id` = '$id' limit 1");
if ($update){
	goToPage("/admin/sections?order=success");
} else {
	goToPage("/admin/sections?order=fail");
}
?>